import numpy as np
import random
import os
from PIL import Image


F = open("/home/handewei/project/segment/CA-Net/data/coronary_new_3204.list")
newTotal = F.readlines()

FF = open("/home/handewei/project/segment/CA-Net/data/valid.txt")
src= FF.readlines()

FFF = open("/home/handewei/project/segment/CA-Net/data/valid_filtered.txt", 'w')

test_filtered = []
index = 0
for line in src:
    print(line)
    if line in newTotal:
        test_filtered.append(line)

    # index += 1
    # if index > 10:
    #     break

FFF.writelines(test_filtered)
FFF.close()